package com.ycp.erp.warehouse.ui.activity;

import android.annotation.SuppressLint;
import android.widget.TextView;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.jakewharton.rxbinding2.view.RxView;
import com.one.common.config.RouterPath;
import com.one.common.model.extra.BaseExtra;
import com.one.common.view.base.BaseActivity;
import com.one.common.view.widget.MyTitleBar;
import com.ycp.erp.R;
import com.ycp.erp.warehouse.model.extra.WarehouseExtra;

import java.io.Serializable;
import java.util.concurrent.TimeUnit;

import butterknife.BindView;

/**
 * Class Des:
 * Created by bjh on 2021/9/1.
 */
@Route(path = RouterPath.WAREHOUSE_SUCCESS)
public class WarehouseSuccessAcitvity extends BaseActivity {
    @BindView(R.id.tvDetail)
    TextView tvDetail;
    @BindView(R.id.tvAgain)
    TextView tvAgain;
    @BindView(R.id.tvHint)
    TextView tvHint;
    @Override
    protected void initPresenter() {

    }

    @Override
    public int getLayoutResId() {
        return R.layout.activity_warehouse_success;
    }

    @SuppressLint("CheckResult")
    @Override
    public void initView() {
        super.initView();
        RxView.clicks(tvDetail).throttleFirst(500, TimeUnit.MILLISECONDS).subscribe(o -> {
        });
        RxView.clicks(tvAgain).throttleFirst(500, TimeUnit.MILLISECONDS).subscribe(o -> {
        });
    }

    @Override
    public void initData() {
        super.initData();
        WarehouseExtra extra = (WarehouseExtra) getIntent().getSerializableExtra(BaseExtra.getExtraName());
        if (extra!=null){
            getMyTitleBar().setMode(MyTitleBar.Mode.BACK_TITLE)
                    .setTitleText(extra.getTitle()).hideLine();
            tvHint.setText(extra.getHint());
        }

    }
}
